/*   **********************************************************************  **
 **   Copyright notice                                                       **
 **                                                                          **
 **   (c) 2009, Around(J2)ME				                                 **
 **   All rights reserved.                                                   **
 **                                                                          **
 **   This program and the accompanying materials are made available under   **
 **   the terms of the New BSD License which accompanies this    			 **
 **   distribution.											                 **
 **   A copy is found in the textfile LICENSE.txt							 **
 **                                                                          **
 **   This copyright notice MUST APPEAR in all copies of the file!           **
 **                                                                          **
 **   Main developers:                                                       **
 **     Juri Strumpflohner		http://blog.js-development.com	             **
 **		Matthias Braunhofer		http://matthias.jimdo.com                    **
 **                                                                          **
 **  **********************************************************************  */

package com.aroundj2me.uicomponents;

import javax.microedition.lcdui.CustomItem;
import javax.microedition.lcdui.Graphics;
/**
 * UI component displaying a horizontal line on the screen.
 * This may be especially useful for separating the displayed 
 * UI components into sections
 *
 */
public class HLine extends CustomItem {
	private int width = 50;
	private final int height= 2;
	
	protected HLine() {
		super(null);
	}
	
	public HLine(int width){
		super(null);
		this.width = width;
	}

	protected int getMinContentHeight() {
		return height;
	}

	protected int getMinContentWidth() {
		return width;
	}

	protected int getPrefContentHeight(int arg0) {
		return getMinContentHeight();
	}

	protected int getPrefContentWidth(int arg0) {
		return getMinContentWidth();
	}

	protected void paint(Graphics g, int w, int h) {
		g.drawRect(0, 0, w-1, h-1);
	}

}
